<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of fiscalYear
 *
 * @author nstevens
 */
class fiscalYear {

    public $fy, $totalFunding, $totalAllocated;
    public $projects;

    public function __construct($fy) {
        $this->fy = $fy;
        $this->init();
    }

    public function init() {
        $this->projects = array();
        $projectResult = executeSelect("SELECT * FROM project WHERE $this->fy=fy");
        while ($row = mysqli_fetch_array($projectResult)) {
            $projectObj = new projectModelClass();
            $projectObj->init2($row, 0);
            array_push($this->projects, $projectObj);
        }
        $fundingResult = executeSelect("SELECT * FROM fiscalyear WHERE year=$this->fy");
        if ($fundingResult) {
            $row = mysqli_fetch_array($fundingResult);
            $this->totalAllocated = $row['totalAllocated'];
            $this->totalFunding = $row['totalFunding'];
        }
    }

   
}

?>
